// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
using System;

namespace KnessetCore.Members
{
	/// <summary>
	/// Handles the entire time manipulation of members.
	/// Working hours are defined per day.
	/// </summary>
	public interface ITimeView
	{
		/// <summary>
		/// Add working hours. The accumulated hours are for today, If you
		/// want to add to a different date use the overloaded method.
		/// </summary>
		/// <param name="span">Working hours to add to the total working hours.</param>
		/// <exception cref="KnessetMembersException">Error while adding working hours.</exception>
		/// <exception cref="MemberDoesNotExistException">Member does not exist.</exception>
		void AddWorkingHours(TimeSpan span);
		/// <summary>
		/// Get total hours accumulated between an interval.
		/// </summary>
		/// <param name="end">End of interval. Value returned includes this day.</param>
		/// <param name="start">Start of interval. Value returned includes this day.</param>
		/// <returns>Total working hours including both 'start' and 'end'</returns>
		/// <exception cref="KnessetMembersException">Error while retrieving working hours.</exception>
		/// <exception cref="ArgumentException">'end' is less than 'start' </exception>
		/// <exception cref="MemberDoesNotExistException">Member does not exist.</exception>
		TimeSpan GetTotalHours(DateTime end, DateTime start);
		/// <summary>
		/// Add working hours.
		/// </summary>
		/// <param name="span">Working hours to add to the total working hours.</param>
		/// <param name="date">Date to which to add working hours.</param>
		/// <exception cref="KnessetMembersException">Error while adding working hours.</exception>
		/// <exception cref="MemberDoesNotExistException">Member does not exist.</exception>
		void AddWorkingHours(TimeSpan span, DateTime date);
	}
}